app.service('uploadService',function ($http) {

    this.uploadFile=function(){
        /**
         *使用formdata来提交整个form表单的
         */
        var formData=new FormData();
        formData.append("file",file.files[0]);
        return $http({
            method:'POST',
            url:"../upload.do",
            data: formData,
            headers: {'Content-Type':undefined},
            transformRequest: angular.identity
        });
    }
});